﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="/Scripts/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="/Scripts/jquery-ui-1.8.11.js"></script>
<link href="/Content/modal.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/Scripts/bmpoker.js"></script>
<script type="text/javascript">

    $(function () {
        $('#check-modal, #pay-modal').dialog({
            modal: true,
            autoOpen: false,
            width: 300,
            height: 200,
            open: function (event, ui) {

            },
            close: function (event, ui) {
            }
        });

        $('#check-view-modal').dialog({
            modal: true,
            autoOpen: false,
            width: 350,
            height: 800,
        });

        
        $('#find').click(function () {
            $.get("@Url.Action("FindCheck", "Stake")", { number: $('#checknumber').val() }, function (data) {
                if (data.isWinning)
                {
                    $('#checknumberhidden').val($('#checknumber').val());
                    $('#pay').show();
                } else {
                    
                    $('#pay').hide();
                }
                $('#paySum').html(data.message);

                $('#check-modal').dialog("close");
                $('#checknumber').val("");
                $('#pay-modal').dialog('open');
            });
        })

        
        $('#pay').click(function () {
            $.get("@Url.Action("PayCheck", "Stake")", { number: $('#checknumberhidden').val() }, function (data) {
                if (data.status)
                {
                    alert("ok");
                } else 
                {
                    alert("error");
                }
                $('#pay-modal').dialog('close');
            });
        }) 

        $('.cancel').click(function () {
            $(this).parent().dialog( "close" );
        })

        $('#history-modal').dialog({
            modal: true,
            autoOpen: false,
            width: 800,
            height: 600,
            open: function (event, ui) {
                $('#history-date-from').datepicker().click(function () {
                    $(this).datepicker('show');
                });
                $('#history-date-to').datepicker().click(function () {
                    $(this).datepicker('show');
                });
            },
            close: function (event, ui) {
                $('#history-date-from').datepicker('destroy');
                $('#history-date-to').datepicker('destroy');
            },
            buttons: {
                "Хорошо": function () { $(this).dialog("close"); }
            }
        });

        $("#history-get").click(function () {
            var fromDate = $('#history-date-from').val();
            var toDate = $('#history-date-to').val();

            $("#stake-history").load("/Stake/GetHistory", { fromDate: fromDate, toDate: toDate });

        });

        $('#history-div').click(function () {
            $("#stake-history").load("/Stake/GetHistory", function () {

                $('.blue-stake,.red-stake,.green-stake').live("click", function () {
                    var id = $(this).data('id'); 
                    $("#check-view-modal").load("/Check/Index/" + id, function() {
                        $('#check-view-modal').dialog('open');
                    }); 
                });

            });
            $('#history-modal').dialog('open');
        });

        $('#check-div').click(function () {
            $('#check-modal').dialog('open');
        });
    });

</script>
<title>Poker Cashier GUI</title>
<link rel="stylesheet" href="/Content/css.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7/themes/smoothness/jquery-ui.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
</head>
<body>
	<div class="PBShadow" style="height: 20px; width:274px;position:absolute; top: 29px; left: 31px;"></div>
	<div  id="progressBar" style="height: 20px; width:275px;position:absolute; top: -20px; left: 30px;"><div id="progress_bar" class="ui-progress-bar ui-container"><div class="ui-progress" style="width: 100%;"></div></div></div>
	<div class="shadowDraw" style="height: 40px; width:260px;position:absolute; top: 1px; left: 10px;">Осталось времени до </div>
	<div id="draw" class="shadowDraw" style="height: 40px; width:160px;position:absolute; top: 1px; left: 200px;"></div>
	<div class="shadowDraw" style="height: 40px; width:100px;position:absolute; top: 53px; left: 20px;">Раунд </div>
	<div id="round" class="shadowRound" style="height: 40px; width:40px;position:absolute; top: 50px; left: 110px;"></div>
	
	<table Style="position:absolute; top: 5px; left:350px;">
	<tr>
	<td class="flop cardPlace" align="center"><b class="opac">Flop</b></td>
	<td class="flop cardPlace" align="center"><b class="opac">Flop</b></td>
	<td class="flop cardPlace" align="center"><b class="opac">Flop</b></td>
	<td class="turn cardPlace" align="center"><b class="opac">Turn</b></td>
	<td class="river cardPlace" align="center"><b class="opac">River</b></td>
	</tr>
	</table>
    
    <div id="check-div" class="shadowDraw" style="position:absolute; top: 5px ; left:750px; cursor:pointer;">Проверка</div>
    <div id="history-div" class="shadowDraw" style="position:absolute; top: 5px ; left:850px; cursor:pointer;">Отчет</div>
	
	<table width=78% cellpadding=5 style="border: solid 0px; position:absolute; top: 100px; left: 10px;" >
		<tr>
			<td align="center" width=50%>
			<div class="table">
				<table>
					<tr>
						<td><input id="one0K" class="butSumm button black odd" type="button" value=""/>
							<div id="one0N" class="shadowWhite" style=""></div></td>
						<td><input id="one1K" class="button black butSumm odd" type="button" value=""/>
							<div id="one1N" class="shadowWhite" style=""></div></td>
					</tr>
					<tr>
						<td><input id="one2K" class="button black butSumm odd" type="button" value=""/>
							<div id="one2N" class="shadowWhite" style=""></div></td>
						<td><input id="one3K" class="button black butSumm odd" type="button" value=""/>
							<div id="one3N" class="shadowWhite" style=""></div></td>
					</tr>
				</table>
				</div>
			</td>
			<td align="center" width=50%>
			<div class="table">
				<table>
					<tr>
						<td><input id="two0K" class="button black butSumm odd" type="button" value=""/>
							<div id="two0N" class="shadowWhite" style=""></div></td>
						<td><input id="two1K" class="button black butSumm odd" type="button" value=""/>
							<div id="two1N" class="shadowWhite" style=""></div></td>
						<td><input id="two2K" class="button black butSumm odd" type="button" value=""/>
							<div id="two2N" class="shadowWhite" style=""></div></td>
					</tr>
					<tr>
						<td><input id="two3K" class="button black butSumm odd" type="button" value=""/>
							<div id="two3N" class="shadowWhite" style=""></div></td>
						<td><input id="two4K" class="button black butSumm odd" type="button" value=""/>
							<div id="two4N" class="shadowWhite" style=""></div> </td>
						<td><input id="two5K" class="button black butSumm odd" type="button" value=""/>
							<div id="two5N" class="shadowWhite" style=""></div> </td>
					</tr>
				</table>
				</div>
			</td>
		</tr>
		<tr>
			<td align="center">
			<div class="table">
			
				<table>
					<tr>
						<td><input id="three0K" class="button black butSumm odd" type="button" value=""/>
							<div id="three0N" class="shadowWhite" style=""></div> </td>
						<td><input id="three1K" class="button black butSumm odd" type="button" value=""/>
							<div id="three1N" class="shadowWhite" style=""></div> </td>
						<td><input id="three2K" class="button black butSumm odd" type="button" value=""/>
							<div id="three2N" class="shadowWhite" style=""></div> </td>
						<td><input id="three3K" class="button black butSumm odd" type="button" value=""/>
							<div id="three3N" class="shadowWhite" style=""></div> </td>
					</tr>
					<tr>
						<td><input id="three4K" class="button black butSumm odd" type="button" value=""/>
							<div id="three4N" class="shadowWhite" style=""></div> </td>
						<td><input id="three5K" class="button black butSumm odd" type="button" value=""/>
							<div id="three5N" class="shadowWhite" style=""></div> </td>
						<td><input id="three6K" class="button black butSumm odd" type="button" value=""/>
							<div id="three6N" class="shadowWhite" style=""></div> </td>
						<td><input id="three7K" class="button black butSumm odd" type="button" value=""/>
							<div id="three7N" class="shadowWhite" style=""></div> </td>
					</tr>
				</table>
				</div>				
			</td>
			<td align="center">


			
				<table border=0 bgcolor="#666666" style="border:solid 1px black;">
				<tr>
					<td>
							<table border=0 bgcolor="#666666">
								<tr>
									<td class="whiteText">Игрок</td>
									<td class="whiteText">Коэф.</td>
									<td class="whiteText">Сумма</td>
									<td class="whiteText">Удалить</td>
								</tr>
								<tr>
									<td><input id="name1" style="background: #ffff66" class="white input" value="" readonly/></td>
									<td><input id="coef1" style="background: #ffff66" class="white input" value="" readonly/></td>
									<td><input id="summ1" style="background: #ffff66" class="white inputPSumm" value="" readonly/></td>
									<td align="center"><input id="del1" class="button black butDel" type="button" value="x"/></td>
								</tr>
								<tr>
									<td><input id="name2" style="background: #ffff66" class="white input" value="" readonly/></td>
									<td><input id="coef2" style="background: #ffff66" class="white input" value="" readonly/></td>
									<td><input id="summ2" style="background: #ffff66" class="white inputPSumm" value="" readonly/></td>
									<td align="center"><input id="del2" class="button black butDel" type="button" value="x"/></td>
								</tr>
								<tr>
									<td><input id="name3" style="background: #ffff66" class="white input" value="" readonly/></td>
									<td><input id="coef3" style="background: #ffff66" class="white input" value="" readonly/></td>
									<td><input id="summ3" style="background: #ffff66" class="white inputPSumm" value="" readonly/></td>
									<td align="center"><input id="del3" class="button black butDel" type="button" value="x"/></td>
								</tr>
								<tr>
									<td><input id="name4" style="background: #ffffff" class="white input" value="" readonly/></td>
									<td><input id="coef4" style="background: #ffffff" class="white input" value="" readonly/></td>
									<td><input id="summ4" style="background: #ffffff" class="white inputPSumm" value="" readonly/></td>
									<td align="center"><input id="del4" class="button black butDel" type="button" value="x"/></td>
								</tr>
								<tr>
									<td><input id="name5" style="background: #ffffff" class="white input" value="" readonly/></td>
									<td><input id="coef5" style="background: #ffffff" class="white input" value="" readonly/></td>
									<td><input id="summ5" style="background: #ffffff" class="white inputPSumm" value="" readonly/></td>
									<td align="center"><input id="del5" class="button black butDel" type="button" value="x"/></td>
								</tr>
								
							</table>


					</td>
					<td>
						<table cellpadding=3 bgcolor="#666666">
							<tr>
								<td colspan=2><input id="totalSumm" class="white inputSumm" value="0"/></td>
								
								<td rowspan=2><input class="calc button black butPrint" type="button" value="Print..."/></td>
								
							</tr>
							<tr>
								<td><input id="express" class="white coefExpress" value="0" readonly/></td>
								<td><input id="buttonExpress" class="calc button black butExpress" type="button" value="Combi"/></td>
								
							</tr>
							<tr>
								<td><input class="calc button black butSumm" type="button" value="500"/></td>
								<td><input class="calc button black butSumm" type="button" value="1000"/></td>
								<td><input class="calc button black butSumm" type="button" value="5000"/></td>
							</tr>
							<tr>
								<td><input class="calc button black butSumm" type="button" value="100"/></td>
								<td><input class="calc button black butSumm" type="button" value="200"/></td>
								<td><input class="calc button black butSumm" type="button" value="300"/></td>
							</tr>
							<tr>
								<td><input class="calc button black butSumm" type="button" value="20"/></td>
								<td><input class="calc button black butSumm" type="button" value="25"/></td>
								<td><input class="calc button black butSumm" type="button" value="50"/></td>
							</tr>
							<tr>
								<td><input class="calc button black butSumm" type="button" value="5"/></td>
								<td><input class="calc button black butSumm" type="button" value="10"/></td>
								<td><input class="calc button black butSumm" type="button" value="Clear"/></td>
							</tr>
						</table>


					</td>
				</tr>
			</table>
			</td>
		</tr>
		
	</table>
	
	<div id="log"></div>
        
        
    <input type="hidden" id="checknumberhidden" value="" />

    <div id="check-modal" style="display:none">
        <input type="text" id="checknumber" value="" />
        <input type="button" value="Отменить" class="cancel"/>
        <input type="button" value="Найти" id="find"/>
    </div>

    <div id="pay-modal" style="display:none">
        <label id="paySum">1234</label> <br />
        <input type="button" value="Отменить" class="cancel"/>
        <input type="button" value="Платить" id="pay"/>
    </div>

    <div id="history-modal" style="display:none"> 
    <span class="span-text">Дата начала отчета:</span>
    <input type="text" id="history-date-from" value="@ViewBag.CurrentDate"/>
    <span class="span-text">Дата окончания отчета:</span>
    <input type="text" id="history-date-to" value="@ViewBag.CurrentDate"/>
    <input type="button" value="Показать" id="history-get"/>
    <div id="stake-history"></div>
    </div>

    <div id="check-view-modal" style="display:none">
    
    </div>
</body>
</html>

